<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>慢慢买-第五组</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/module.css">
    <link rel="stylesheet" href="../css/register.css">
    <link rel="stylesheet" href="../lib/fonts/font_awesome/css/font-awesome.css">
</head>

<body>
    <!-- 头部 -->
    <header>
        <a class="btn-back" href="javascript:;">
            <span class="fa fa-angle-left"></span>
        </a>
        <div class="title">优惠券</div>
        <a href="javascript:;"></a>
    </header>

    <!-- 内容 -->
    <div class="registre_content">
        <input type="text" id="inp1" placeholder="请输入同户名">
        <span></span>
        <input type="text" id="inp2" placeholder="密码(6-20个字符)">
        <span></span>
        <input type="text" id="inp4" placeholder="请输入手机号">
        <span></span>
        <input type="text" id="inp5" placeholder="请输入邮箱">
        <span></span>
        <button>注册</button>
    </div>

    <!-- 底部 -->
    <footer>
        <div class="footer_top">
            <span>登录</span>
            <span>注册</span>
            <a href="javascript:;" class="back">
                <img src="../images/toTop.jpg" alt="">
                <span>返回顶部</span>
            </a>
        </div>
        <div class="footer_content">
            <div class="footer_link">
                <a href="javascript:;">手机APP下载</a>
                <a href="javascript:;">慢慢买手机版</a>
                <a href="javascript:;">-- 掌上比价平台</a>
            </div>
            <p>m.manmanbuy.com</p>
        </div>
    </footer>
</body>

</html>
<script src="../lib/js/jquery.1.12.4.js"></script>
<script src="../js/module.js"></script>
<script>
    $('button').on('click', function() {
        location.href = '../index.html';
    })
    var inpPwd = $('#inp2');
    var inpEmail = $('#inp5');
    var inpTel = $('#inp4');
    var inpName = $('#inp1');

    function check(inp, regEx) {
        inp.blur(function() {
            if (regEx.test($(this).val())) {
                $(this).next().html('输入正确');
            } else {
                $(this).next().html('输入错误');
            }
        })
    }

    var reg_name = /^[\u4e00-\u9fa5]{2,}$/;
    var reg_mobile = /^0?(1[3-9][0-9])[0-9]{8}$/;
    var reg_pwd = /^[A-Za-z0-9_@.]{6-20}$/;
    var reg_email = /^\w+([+-.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;

    check(inpName, reg_name);
    check(inpPwd, reg_pwd);
    check(inpTel, reg_mobile);
    check(inpEmail, reg_email);
</script>